<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTestListsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('test_lists', function (Blueprint $table) {
            $table->id()->index();
            $table->string('name')->comment('试卷名称')->index();
            $table->unsignedBigInteger('user_id')->comment('创建人');
            $table->unsignedBigInteger('paper_id')->comment('试卷分类id')->index();
            $table->unsignedBigInteger('subject_id')->comment('试卷科目id')->index();
            $table->tinyInteger('type')->default(1)->comment('试卷类型(1:正常试卷，2:练习试卷, 3:闯关试卷)');
            $table->tinyInteger('status')->default(1)->comment('试卷状态(1:发布,0:不发布)');
            $table->string('order')->comment('试题排序');
            $table->json('random')->nullable()->comment('随机题目');
            $table->json('fixed')->nullable()->comment('固定题目');
            $table->tinyInteger('artificial')->default(0)->comment('是否人工阅卷(1:需要人工,0:不需要人工)');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('test_lists');
    }
}
